package com.kfm.base.thread.day03;

import java.time.LocalDateTime;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Demo13 {

    public static void main(String[] args) {
        //  Scheduled
        ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(2);

        scheduledThreadPoolExecutor.scheduleAtFixedRate(() -> {
            System.out.println("hello" + LocalDateTime.now());
        }, 0,2, TimeUnit.SECONDS);
    }
}
